{{define "demo/operate/edit"}}
<!DOCTYPE html>
<html lang="zh"  >
<head>
	{{template "header" (OssUrl)}}
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content   ibox-content">
		<form class="form-horizontal m" id="form-user-edit">
		    <input name="userId" type="hidden"  value="{{.user.UserId}}" />
			<div class="form-group">
				<label class="col-sm-3 control-label">用户编号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="userCode" id="userCode" value="{{.user.UserCode}}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">用户姓名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="userName" id="userName" value="{{.user.UserName}}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">用户性别：</label>
                <div class="col-sm-8">
                    <div class="input-group" style="width: 100%">

                    </div>
                </div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">用户手机：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="userPhone" value="{{.user.UserPhone}}" id="userPhone">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">用户邮箱：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="userEmail" value="{{.user.UserEmail}}" id="userEmail">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">用户状态：</label>
				<div class="col-sm-8">
					<label class="toggle-switch switch-solid">
						<input type="checkbox" id="status" checked="{{if eq .user.Status "0"}}true{{end}}">
						<span></span>
					</label>
				</div>
			</div>
		</form>
	</div>
	{{template "footer" (OssUrl)}}
	<script type="text/javascript">
		var prefix = ctx + "/demo/operate";
		
		$("#form-user-add").validate({
			onkeyup: false,
			rules:{
				userPhone:{
					isPhone:true
				},
				userEmail:{
					email:true
				},
			},
		    focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
{{end}}